You are here: Statements and Functions > End
Syntax samples
END or }
WHILE FREECAP(Loc1) > 5 DO
BEGIN
INC Var2, 5
WAIT 5 sec
END
Defines a statement block along with a corresponding BEGIN statement. BEGIN and END are almost always used in conjunction with other control statements such as IF...THEN and DO...WHILE. Every END must pair with a BEGIN.
Any logic.
Example
Compare the following examples:
The example below includes a BEGIN and END statement in the form of the "{" and "}" symbols. In this logic, if the attribute Attr1 equals one, ten Cases are ordered and the variable, Var1, increments. ProModel executes the statements within the BEGIN and END only if Attr1 equals one.
IF Attr1 = 1 THEN
{
ORDER 10 Case
INC Var1
}
Just as in the logic above, if Attr1 in the following example equals one, ten Cases are ordered. However, Var1 increments no matter what the value of Attr1. Without a statement block, the IF...THEN applies only to the very next statement, no matter how you format the logic.
IF Attr1 = 1 THEN
ORDER 10 Case
INC Var1
BEGIN, IF...THEN, DO...WHILE, WHILE...DO, DO...UNTIL, and END.